//
//  MLStage1.m
//  WaterProof
//
//  Created by victor0321 on 12/1/3.
//  Copyright 2012年 __MyCompanyName__. All rights reserved.
//

#import "MLStage1.h"

@implementation MLStage1

-(id) init
{
	if ((self = [super init]))
	{
		CCLOG(@"===========================================");
        CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
        screenSize = [CCDirector sharedDirector].winSize;
		
        CCSprite* background = [CCSprite spriteWithFile:@"OurHome.png"];
        background.position = CGPointMake(screenSize.width / 2, screenSize.height / 2);
        //background.scaleX = 5;
        //background.scaleY = 2;
        //background.tag = backgroundTag;
        [self addChild:background z:1];
        
        
        [[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"backGround1.mp3" loop:YES];
        self.isTouchEnabled = YES;
        
        [self scheduleUpdate];
        
	}
	return self;
}

-(void)update:(ccTime)delta{
    CCProgressTimer* tvMask = (CCProgressTimer*)[[MLGameLayer sharedLayer] getChildByTag:TV_Mask];
    CCSprite* tvState = (CCSprite*)[[MLGameLayer sharedLayer] getChildByTag:Sunny];
}

-(void) registerWithTouchDispatcher{
	[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:1 swallowsTouches:YES];
}

-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
    
    return YES;
}

-(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event {
    
}


-(void) dealloc
{
	CCLOG(@"===========================================");
    CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
	
	// always call [super dealloc] at the end of every dealloc method
	[super dealloc];
}

@end
